import Mock from "mockjs";
import { Random } from "mockjs";
import video1 from '../assets/video/screen-capture.webm'
import aiicon from '../assets/home/aiicon.png'
import commerce from '../assets/home/commerce.jpg'
import huawei from '../assets/home/huawei.jpg'
import llm from '../assets/home/llm.jpg'
import qianrushi from '../assets/home/qianrushi.jpg'
import java from '../assets/home/category/java.png'
import quanzhan from '../assets/home/category/quanzhan.png'
import sql from '../assets/home/category/course1.png'
import sql2 from '../assets/home/category/course2.png'
import banner1 from '../assets/home/category/banner1.jpg'
import banner2 from '../assets/home/category/banner2.jpg'
import banner3 from '../assets/home/category/banner3.jpg'

//首页
//生成数据
const { courseList } = Mock.mock({
    'courseList|8': [
        {
            'coursename': '@ctitle(10,20)',//课程名称
            courseid: 'courseid-' + '@guid',//课程id
            courseurl: video1,//课程url
            // courseurl:"https://vod.300hu.com/vod/product/90f8f9da-08dc-43c8-8205-bbdb60cb9fad/1091_c7db5e75f_f.mp4?source=1&h265=1092h_e1c47f736_f.mp4",//课程url
            courseimg: "@image('200x100', '#4A7BF7', 'Hello')",
            'courseteacher': '在线课堂' + '@name',//课程主讲人
            'category|1': ['出国留学', 'it-设计', '考研-考证', '英语-语言', '自媒体', '精品课', '音乐-唱歌', '绘画-兴趣'],//课程分类
            "ishot": Random.boolean(),//是否热门视频
            "islatest": Random.boolean(),//是否最新上传视频
            "grade|0-5": 2,//课程评分 1-5
            "stars|1-5": '★',//星星 1-5
            "playercount|1-9999": 666,//播放量
        }
    ]
})
//生成接口 
//获取课程列表
Mock.mock('/api/getCourseList', 'post', (config) => {
    console.log(1, config.body);
    return {
        code: 200,
        mesasge: '获取课程列表数据成功',
        data: {
            courseList: courseList,
            length: courseList.length
        }
    }
})
//获取分类列表
const { categoryList } = Mock.mock({
    categoryList: [
        {
            categoryTitle: '考研-考证',//课程分类
            categoryImg: aiicon,
        },
        {
            categoryTitle: '出国留学',
            categoryImg: commerce
        },
        {
            categoryTitle: 'it-设计',
            categoryImg: huawei
        },

        {
            categoryTitle: '英语-语言',
            categoryImg: llm
        },
        {
            categoryTitle: '自媒体',
            categoryImg: qianrushi
        },
        {
            categoryTitle: '精品课',
            categoryImg: aiicon
        },
        {
            categoryTitle: '音乐-唱歌',
            categoryImg: commerce
        },
        {
            categoryTitle: '绘画-兴趣',
            categoryImg: huawei
        },
    ]
})
//获取分类列表
Mock.mock('/api/getCategoryList', 'post', (config) => {
    console.log(11, config.body);
    return {
        code: 200,
        mesasge: '获取分类列表数据成功',
        data: {
            categoryList: categoryList,
            length: categoryList.length
        }
    }
})
//热门类别
const { hotCategoryList } = Mock.mock({
    hotCategoryList: [
        {
            categoryTitle: '全栈开发',//课程分类
            categoryImg: quanzhan,
        },
        {
            categoryTitle: 'java后端',
            categoryImg: java
        },

    ]
})
Mock.mock('/api/gethotCategoryList', 'post', (config) => {
    console.log(111, config.body);
    return {
        code: 200,
        mesasge: '获取热门类别列表数据成功',
        data: {
            hotCategoryList: hotCategoryList,
            length: hotCategoryList.length
        }
    }
})
//热门课程
const { hotCourseList } = Mock.mock({
    hotCourseList: [
        {
            courseTitle: '基础入门-数据库实战教程',//课程分类
            courseImg: sql,
            courseteacher: '在线课堂--张老师',
            "grade|0-5": 2,//课程评分 1-5
            "stars|1-5": '★',//星星 1-5
            "playercount|1-9999": 666,//播放量
        },
        {
            courseTitle: '适合最新的初学者的现代空间设计',
            courseImg: sql2,
            courseteacher: '在线课堂--koko',
            "grade|0-5": 2,//课程评分 1-5
            "stars|1-5": '★',//星星 1-5
            "playercount|1-9999": 666,//播放量
        },

    ]
})
Mock.mock('/api/gethotCourseList', 'post', (config) => {
    console.log(1111, config.body);
    return {
        code: 200,
        mesasge: '获取热门课程列表数据成功',
        data: {
            hotCourseList: hotCourseList,
            length: hotCourseList.length
        }
    }
})
//热门老师
import person1 from '../assets/home/category/person1.png'
import person2 from '../assets/home/category/person2.png'

const { hotTeacherList } = Mock.mock({
    hotTeacherList: [
        {
            personImg: person1,
            courseteacher: '在线课堂--张老师',
            professional: '软件工程师'
        },
        {

            personImg: person2,
            courseteacher: '在线课堂--koko',
            professional: '首席设计师'
        },

    ]
})
Mock.mock('/api/gethotTeacherList', 'post', (config) => {
    console.log(1111, config.body);
    return {
        code: 200,
        mesasge: '获取热门老师列表数据成功',
        data: {
            hotTeacherList: hotTeacherList,
            length: hotTeacherList.length
        }
    }
})

//登陆注册页面
//验证码
/* const {sendCode}=Mock.mock({
    sendCode:[
        {
            code:
        }
    ]
}) */

//详情列表页面
const { tabList } = Mock.mock({
    tabList: [
        {
            tab: '简介',
            path: '/home'
        },
        {
            tab: '课程',
            path: '/home/coursedetalCourse'
        },
    ]
})
Mock.mock('/api/gettabList', 'post', (config) => {
    console.log(11111, config.body);
    return {
        code: 200,
        mesasge: '获取详情页标签列表数据成功',
        data: {
            tabList: tabList,
            length: tabList.length
        }
    }
})
//本月热门老师+++我的  关注 老师列表
const { hotTeacherMonthList } = Mock.mock({
    'hotTeacherMonthList|8': [
        {
            'icon|1': [icon1,icon2,icon3,icon4,icon5,icon6,icon7],
            'name': '@cname(2,4)',
            'city': 'IP归属地:'+'@province',

        },

    ]
})
Mock.mock('/api/gethotTeacherMonthList', 'post', (config) => {
    console.log(11111, config.body);
    return {
        code: 200,
        mesasge: '获取本月热门老师列表数据成功',
        data: {
            hotTeacherMonthList: hotTeacherMonthList,
            length: hotTeacherMonthList.length
        }
    }
})
////学员名单列表
import icon1 from '../assets/home/detail/icon1.png'
import icon2 from '../assets/home/detail/icon2.png'
import icon3 from '../assets/home/detail/icon3.png'
import icon4 from '../assets/home/detail/icon4.png'
import icon5 from '../assets/home/detail/icon5.png'
import icon6 from '../assets/home/detail/icon6.png'
import icon7 from '../assets/home/detail/icon7.png'
const { studentList } = Mock.mock({
    'studentList|3': [
        {
            'icon|1': [icon1, icon2, icon3, icon4, icon5, icon6, icon7],
            'name': '@cname(2,4)',
            'commentTime': '@integer(1,59)' + '分钟前',
            'description|1': ['学习云计算架构的设计原则与实践，掌握AWS、Azure等云平台的使用。', '代码优化的过程是漫长的，但只要坚持，就能看到成效。', '学习前端框架时，不仅要理解其原理，更要学会灵活运用。', '面对bug时，不要急于寻找解决方法，冷静思考是解决问题的关键。'],
        },

    ]
})
// 生成并输出100条与 IT 开发学习感悟相关的文字
// const experiences = studentList;
Mock.mock('/api/getstudentList', 'post', (config) => {
    console.log('student', config.body);
    return {
        code: 200,
        mesasge: '获取学员名单列表数据成功',
        data: {
            studentList: studentList,
            length: studentList.length
        }
    }
})
//详情的课程图片
const { detailcouresepicList } = Mock.mock({
    'detailcouresepicList|8': [
        {
            'icon|1': [ banner1, banner2, banner3],
            'title': '字节3-1大佬直播【ESLint 前端编码规范化与原理剖析，特邀字节大佬分享团队代码质量把控细节】',
            'lesson': 'Lesson' + '@integer(1,12)',
            'description': '掌握 AI+ GO 高效开发新范式掌握专为 Go 设计的 AI 框架具备AI提效项目开发落地经验提升 AIGC 应用及开发能力增强 AI 高效编程与调思维提升LLM应用及解决问题能力',
        },

    ]
})
// 生成并输出100条与 IT 开发学习感悟相关的文字
// const experiences = studentList;
Mock.mock('/api/getdetailcouresepicList', 'post', (config) => {
    console.log('detailcouresepicList', config.body);
    return {
        code: 200,
        mesasge: '获取学员名单列表数据成功',
        data: {
            detailcouresepicList: detailcouresepicList,
            length: detailcouresepicList.length
        }
    }
})
//用户作业
const { userWorkList } = Mock.mock({
    'userWorkList|8': [
        {
            'icon|1': [ banner1, banner2, banner3],
            'title': '字节3-1大佬直播【ESLint 前端编码规范化与原理剖析，特邀字节大佬分享团队代码质量把控细节】',
            'lesson': 'Lesson' + '@integer(1,12)',
            'description': '掌握 AI+ GO 高效开发新范式掌握专为 Go 设计的 AI 框架具备AI提效项目开发落地经验提升 AIGC 应用及开发能力增强 AI 高效编程与调思维提升LLM应用及解决问题能力',
        },

    ]
})
Mock.mock('/api/getdetailcouresepicList', 'post', (config) => {
    console.log('detailcouresepicList', config.body);
    return {
        code: 200,
        mesasge: '获取学员名单列表数据成功',
        data: {
            userWorkList: userWorkList,
            length: userWorkList.length
        }
    }
})



